#!/usr/bin/env python
# -*- coding: utf-8 -*-

import random

# 求最大公约数，复杂度O(log(2)n)
def gcd(a, b):
    if(a < b):
        tmp = a
        a = b
        b = tmp
    if b == 0: return a
    else: return gcd(b, a % b)

if __name__ == "__main__":
    a = random.randint(0, 500)
    b = random.randint(0, 500)
    print("The greatest common divisor of %d and %d: %d" % (a, b, gcd(a, b)))